﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>窗口函数列表 | AutoHotkey v2</title>
<meta name="description" content="This page lists functions to retrieve information about one or more windows, or make a variety of changes to a window." />
<meta name="ahk:equiv-v1" content="lib/WinSet.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>窗口函数</h1>

<p>函数检索关于一个或多个窗口的信息, 或对窗口进行各种更改. 有关详情, 请点击函数名.</p>
<table class="info">
  <tr>
    <th>函数</th>
    <th abbr="Descr">描述</th>
  </tr>
  <tr>
    <td><a href="WinActivate.htm">WinActivate</a></td>
    <td>激活指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinActivateBottom.htm">WinActivateBottom</a></td>
    <td>和 <a href="WinActivate.htm">WinActivate</a> 一样, 只是它激活了最下面的匹配窗口而不是最上面的.</td>
  </tr>
  <tr>
    <td><a href="WinActive.htm">WinActive</a></td>
    <td>检查指定的窗口是否存在并且当前处于活动状态(最前的).</td>
  </tr>
  <tr>
    <td><a href="WinClose.htm">WinClose</a></td>
    <td>关闭指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinExist.htm">WinExist</a></td>
    <td>检查指定的窗口是否存在.</td>
  </tr>
  <tr>
    <td><a href="WinGetClass.htm">WinGetClass</a></td>
    <td>检索指定窗口的类名.</td>
  </tr>
  <tr>
    <td><a href="WinGetClientPos.htm">WinGetClientPos</a></td>
    <td>检索指定窗口的客户端区域的位置和大小.</td>
  </tr>
  <tr>
    <td><a href="WinGetControls.htm">WinGetControls</a></td>
    <td>返回指定窗口中所有控件的名称.</td>
  </tr>
  <tr>
    <td><a href="WinGetControlsHwnd.htm">WinGetControlsHwnd</a></td>
    <td>返回指定窗口中所有控件的唯一 ID 号.</td>
  </tr>
  <tr>
    <td><a href="WinGetCount.htm">WinGetCount</a></td>
    <td>返回符合指定条件的现有窗口的数目.</td>
  </tr>
  <tr>
    <td><a href="WinGetID.htm">WinGetID</a></td>
    <td>返回指定窗口的唯一 ID 号.</td>
  </tr>
  <tr>
    <td><a href="WinGetIDLast.htm">WinGetIDLast</a></td>
    <td>如果找到多个匹配窗口, 则返回最后的/最底部的窗口的唯一 ID 号.</td>
  </tr>
  <tr>
    <td><a href="WinGetList.htm">WinGetList</a></td>
    <td>返回与指定条件匹配的所有现有窗口的唯一 ID 号.</td>
  </tr>
  <tr>
    <td><a href="WinGetMinMax.htm">WinGetMinMax</a></td>
    <td>返回指定窗口是最大化还是最小化的状态.</td>
  </tr>
  <tr>
    <td><a href="WinGetPID.htm">WinGetPID</a></td>
    <td>返回指定窗口的进程 ID.</td>
  </tr>
  <tr>
    <td><a href="WinGetPos.htm">WinGetPos</a></td>
    <td>获取指定窗口的位置和大小.</td>
  </tr>
  <tr>
    <td><a href="WinGetProcessName.htm">WinGetProcessName</a></td>
    <td>返回指定窗口的进程的名称.</td>
  </tr>
  <tr>
    <td><a href="WinGetProcessPath.htm">WinGetProcessPath</a></td>
    <td>返回拥有指定窗口的进程的完整路径和名称.</td>
  </tr>
  <tr>
    <td><a href="WinGetStyle.htm">WinGetStyle<br>WinGetExStyle</a></td>
    <td>分别返回指定窗口的样式或扩展样式.</td>
  </tr>
  <tr>
    <td><a href="WinGetText.htm">WinGetText</a></td>
    <td>检索指定窗口的文本.</td>
  </tr>
  <tr>
    <td><a href="WinGetTitle.htm">WinGetTitle</a></td>
    <td>检索指定窗口的标题.</td>
  </tr>
  <tr>
    <td><a href="WinGetTransColor.htm">WinGetTransColor</a></td>
    <td>返回指定窗口中标记为透明的颜色.</td>
  </tr>
  <tr>
    <td><a href="WinGetTransparent.htm">WinGetTransparent</a></td>
    <td>返回指定窗口的透明度的等级.</td>
  </tr>
  <tr>
    <td><a href="WinHide.htm">WinHide</a></td>
    <td>隐藏指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinKill.htm">WinKill</a></td>
    <td>强制关闭指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinMaximize.htm">WinMaximize</a></td>
    <td>将指定的窗口放大到最大尺寸.</td>
  </tr>
  <tr>
    <td><a href="WinMinimize.htm">WinMinimize</a></td>
    <td>将指定的窗口最小化为任务栏上的按钮.</td>
  </tr>
  <tr>
    <td><a href="WinMinimizeAll.htm">WinMinimizeAll<br>WinMinimizeAllUndo</a></td>
    <td>最小化或还原所有窗口.</td>
  </tr>
  <tr>
    <td><a href="WinMove.htm">WinMove</a></td>
    <td>改变指定窗口的位置和/或大小.</td>
  </tr>
  <tr>
    <td><a href="WinMoveBottom.htm">WinMoveBottom</a></td>
    <td>发送指定的窗口到堆栈的底部; 也就是说, 在所有其他窗口下方.</td>
  </tr>
  <tr>
    <td><a href="WinMoveTop.htm">WinMoveTop</a></td>
    <td>将指定的窗口移到堆栈顶部, 而无需显式激活它.</td>
  </tr>
  <tr>
    <td><a href="WinRedraw.htm">WinRedraw</a></td>
    <td>重绘指定窗口.</td>
  </tr>
  <tr>
    <td><a href="WinRestore.htm">WinRestore</a></td>
    <td>如果指定的窗口处于最小化或最大化状态, 则还原它.</td>
  </tr>
  <tr>
    <td><a href="WinSetAlwaysOnTop.htm">WinSetAlwaysOnTop</a></td>
    <td>使指定的窗口停留在所有其他窗口的顶部(除了其他置顶的窗口).</td>
  </tr>
  <tr>
    <td><a href="WinSetEnabled.htm">WinSetEnabled</a></td>
    <td>启用或禁用指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinSetRegion.htm">WinSetRegion</a></td>
    <td>将指定窗口的形状改为指定的矩形, 椭圆或多边形.</td>
  </tr>
  <tr>
    <td><a href="WinSetStyle.htm">WinSetStyle<br>WinSetExStyle</a></td>
    <td>分别改变指定窗口的样式和扩展样式.</td>
  </tr>
  <tr>
    <td><a href="WinSetTitle.htm">WinSetTitle</a></td>
    <td>更改指定窗口的标题.</td>
  </tr>
  <tr>
    <td><a href="WinSetTransColor.htm">WinSetTransColor</a></td>
    <td>使所选颜色的所有像素在指定的窗口内不可见(透明).</td>
  </tr>
  <tr>
    <td><a href="WinSetTransparent.htm">WinSetTransparent</a></td>
    <td>使指定的窗口半透明.</td>
  </tr>
  <tr>
    <td><a href="WinShow.htm">WinShow</a></td>
    <td>显示指定的窗口.</td>
  </tr>
  <tr>
    <td><a href="WinWait.htm">WinWait</a></td>
    <td>等待直到指定的窗口存在.</td>
  </tr>
  <tr>
    <td><a href="WinWaitActive.htm">WinWaitActive<br>WinWaitNotActive</a></td>
    <td>等待直到指定的窗口处于活动或不活动状态.</td>
  </tr>
  <tr>
    <td><a href="WinWaitClose.htm">WinWaitClose</a></td>
    <td>等待直到找不到匹配的窗口.</td>
  </tr>
</table>

<h2 id="Remarks">备注</h2>
<p>要发现鼠标当前悬停的窗口的唯一 ID 号, 请使用 <a href="MouseGetPos.htm">MouseGetPos</a>.</p>
<p>窗口标题和文本是区分大小写的. 除非 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a> 被打开, 否则不会检测隐藏窗口.</p>

<h2 id="Related">相关</h2>
<p><a href="SetWinDelay.htm">SetWinDelay</a>, <a href="Control.htm">控件函数</a>, <a href="Gui.htm">Gui 对象</a>(脚本创建的窗口)</p>

</body>
</html>